<?php
/**
 * Fetch web page bebind login prompte. 
 * 
 * If browser below url, it will ask you a username and password. 
 * http://localhost/phpapps/phpstudy/apache_pwd_control/readme.html  <- use apache access control to set up.
 */
$c = curl_init('http://localhost/phpapps/phpstudy/apache_pwd_control/readme.html');
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_USERPWD, 'user1:pass1');		// login option
$page = curl_exec($c);
curl_close($c);
print $page;
?>